package com.baizhi.serviceImpl;

import com.baizhi.dao.BookDao;
import com.baizhi.entity.Book;
import com.baizhi.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class BookServiceImpl implements BookService {

    @Autowired
    private BookDao bd;
    @Override
    public Map fy(int page, int rows) {

        int count = bd.getCount();

        int stary = (page-1)*rows;

        List<Book> list = bd.getBook(stary,rows);

        Map map = new HashMap();
        map.put("total",count);
        map.put("rows",list);
        return map;
    }
}
